import {request} from '@/apis';
import {request as requestAxios} from '@vc/request';
import {addPrefix} from "@/utils";

const prefixUrl = '/user-center';

const Api = {
  addCollection: '/addCollectionEvents',
  removeCollection: '/removeCollectionEvents',
  addCompany: '/monitors/detail/addCompany',
  removeCompany: '//monitors/detail/deleteByIds',
};
addPrefix(Api, prefixUrl);
/** 获取文件内容 */
export const getFileContentApi = (config) =>
  requestAxios.get(config, {
    apiUrl: '',
    isTransformResponse: false,
    isReturnNativeResponse: true,
    errorMessageCustom: true,
    withToken: false
  });

/** 获取正文内容 */
export const getContentApi = (params) =>
  request.get({
    url: '/ep-query/mainContent',
    params
  }, {isTransformResponse: false});

/** 添加资讯收藏 */
export const addCollection = (params) => request.post({
  url: Api.addCollection,
  params,
  data: params
});
/** 取消资讯收藏 */
export const removeCollection = (params) => request.post({
  url: Api.removeCollection,
  params,
  data: params
});
/** 监控企业 */
export const addCompany = (params) => request.post({
  url: Api.addCompany,
  params,
});
/** 取消监控 */
export const removeCompany = (params) => request.delete({
  url: Api.removeCompany,
  params
});
